package cn.richx.pushmessage.rpc.feign;

import cn.richx.pushmessage.domain.UserDTO;
import cn.richx.pushmessage.pojo.RichHttpResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;


@FeignClient(value = "uaa")
public interface UserService {

    @GetMapping("/api/usersById/{id}")
    public RichHttpResponse<UserDTO> getUserById(@PathVariable("id") Long id, @RequestHeader("X-BaseID") String baseId);

    @GetMapping("/api/users-by-ids/{ids}")
    public ResponseEntity<List<UserDTO>> getUsersByIdList(@PathVariable("ids") List<Long> ids, @RequestHeader("X-BaseID") String baseId);

    @GetMapping("/api/usersByPhone/{phone}")
    public RichHttpResponse<UserDTO> getUserByPhone(@PathVariable("phone") String phone, @RequestHeader("X-BaseID") String baseId);
}
